package Unicart.applogicFake_1;

import Unicart.applogic.UserHelper;
import Unicart.model.User;

public class UserHelperFake_1 implements UserHelper {
	
	private User user;
	
	@Override
	public void loginAs(User user) {
		if (user.getPassword().equals("wrong")) {
			return;
		}
		this.user = user;
	}
	
	@Override
	public void logout() {
	    this.user = null;
	}

	@Override
	public boolean isLoggedIn() {
	    return user != null;
	}

	@Override
	public boolean isLoggedInAs(User user) {
	    return isLoggedIn() && this.user.getLogin().equals(user.getLogin());
	}

	@Override
	public boolean isNotLoggedIn() {
	    return user == null;
	}

	@Override
	public void createUser(User user) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void changeUserInfo(User user) {
		// TODO Auto-generated method stub
		
	}

	
}
